﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using UFSSWebApp.UFSSservicereference;

namespace UFSSWebApp
{
    public partial class upload : System.Web.UI.Page
    {
        private UFSSserviceSoapClient ussc = new UFSSserviceSoapClient();
        protected void Page_Load(object sender, EventArgs e)
        {
            ddlSubscriptions.Items.Add("[none]");
            UFSSSubscription[] subs = ussc.getSubs((UserCreds)Session["usercreds"]);
            foreach (UFSSSubscription sub in subs)
                ddlSubscriptions.Items.Add(sub.subName);
        }

        protected void btnUpload_Click(object sender, EventArgs e)
        {
            byte[] filebytes = fuFile.FileBytes;
            //if(ddlSubscriptions.SelectedIndex==0)
                //ussc.UploadFile((UserCreds)Session["usercreds"], filebytes, txtName.Text, -1);
            //else
                ussc.UploadFile((UserCreds)Session["usercreds"], filebytes, fuFile.FileName, null);
        }

        protected void chkAgree_CheckedChanged(object sender, EventArgs e)
        {
            //if (chkAgree.Checked == true)
            //    btnUpload.Enabled = true;

        }
    }
}
